home *** CD-ROM | disk | FTP | other *** search
- global gthePath, startColorDepth, startSoundVolume, gProgramInstalled, gREADME3, gREADME4, gREADME5, gREADME6, gREADME3Menu, gREADME4Menu, gREADME5Menu, gREADME6Menu, PAGELENGTH, gCurrentPage, gCurrentMenu, gMenuItemClicked, gTotalPages, gCurrentTextField, gCurrentSection, gCurrentTopic, gCurrentSubTopic, gTheFindHitLine, gMenuList, gMenuStructureList, pathSeparator, gMediaPath, gAppSuffix, gCurrentSubMenuLines, gImageChannel, gMovieChannel, gImageSuffix, gMovieSuffix, gTextFieldChannel, gNextPageChannel, gPrevPageChannel, videoPlaying, MIAWPlaying, myMIAW, gPrintButtonChannel, gHiliteChannel, dontDoRolloverUntil, gBlinkNextPage, gHeadingChannel, QTsliderChannel, QTsliderConstraint, QTPlayChannel, QTRewindChannel, QTFFChannel, QTStopChannel, alertBoxChannel, alertTextChannel, alertOkayChannel, alertCancelChannel, alertLeftButtonText, alertRightButtonText, theActiveMenuSprite, gOkayAction, gCancelAction, alertBoxShowing, videoPlayState, soundPlaying, helpBoxChannel, helpTextChannel, helpDelayTicks, helpMouseLoc, lastHelpOff, gMacInstallPath, gPCInstallPath, gMacCDName, NewSelectPoint, gNextAttractNum, gNextAttractTime, gAttractNumberList, waitBetweenAttract, gNextPageDownCast, gPrevPageDownCast, gNextPageUpCast, gPrevPageUpCast, spinnerCastList, ImageAndTextBG, ImageBG, QTBG, GrayHilite, BlackHilite, BigHelp, SmallHelp, ZoomText, zoomableImage, SubMenuWindow, gSubMenuLine, MIAWPath, theLaunchList
-
- on processSubMenu thePassedInLine
- if thePassedInLine > 0 then
- set theMenuLine to thePassedInLine
- else
- set theMenuLine to gSubMenuLine
- end if
- set gMenuItemClicked to line theMenuLine of field "Submenu"
- if gCurrentSection = "Install" then
- if gMenuItemClicked contains "Install " then
- doInstall()
- end if
- end if
- displaySubMenu(thePassedInLine)
- end
-
- on newDisplayText aMenuList, destinationField, thePassedInLine
- global gCurrentMenuHierarchy, gCurrentPageList, gCurrentLevelSelect
- set depthCount to count(gCurrentMenuHierarchy)
- set currentDepth to getAt(gCurrentLevelSelect, 1)
- set currentSelectionAtDepth to getAt(gCurrentLevelSelect, 2)
- if currentDepth > 1 then
- repeat with i = 1 to depthCount
- if i = currentDepth then
- exit repeat
- end if
- set theMenuList to getAt(aMenuList, getAt(gCurrentMenuHierarchy, i))
- set aMenuList to getaProp(theMenuList, #SubMenu)
- end repeat
- set theMenu to getAt(aMenuList, currentSelectionAtDepth)
- else
- set theMenu to getAt(aMenuList, currentSelectionAtDepth)
- end if
- set gCurrentPageList to getProp(theMenu, #PageList)
- set gTotalPages to count(gCurrentPageList)
- set gCurrentPage to 1
- DisplayThePage(destinationField, thePassedInLine)
- if gTotalPages > 1 then
- set gBlinkNextPage to [the ticks + 60, the ticks + 80, the ticks + 100]
- end if
- end
-
- on CleanUpPage
- global gFirstMenuChannel
- if videoPlaying then
- set videoPlaying to 0
- spriteVisibles(27, 31, 0)
- set the locH of sprite QTsliderChannel to -1000
- puppetSprite(QTsliderChannel, 0)
- set the visible of sprite QTsliderChannel to 0
- end if
- if MIAWPlaying = 1 then
- if objectp(myMIAW) then
- forget(myMIAW)
- end if
- set MIAWPlaying to 0
- spriteVisibles(27, 31, 0)
- set the locH of sprite QTsliderChannel to -1000
- puppetSprite(QTsliderChannel, 0)
- set the visible of sprite QTsliderChannel to 0
- end if
- set the locH of sprite gImageChannel to -1000
- set the cursor of sprite gMovieChannel to 0
- set zoomableImage to 0
- set the locH of sprite gMovieChannel to -1000
- set the locH of sprite gTextFieldChannel to -1000
- repeat with i = gFirstMenuChannel to gFirstMenuChannel + 5
- set the locH of sprite i to -1000
- end repeat
- updateStage()
- set theLaunchList to EMPTY
- set the visible of sprite gImageChannel to 0
- set the visible of sprite gMovieChannel to 0
- puppetSprite(gMovieChannel, 0)
- set the visible of sprite gTextFieldChannel to 0
- end
-
- on DisplayThePage destinationField, thePassedInLine
- global gCurrentPageList, gTextFieldChannel, gPlatformNum, gCurrentMenuList, gFirstMenuChannel, gMagCurs, gMagCursMask
- if thePassedInLine > 0 then
- return
- end if
- CleanUpPage()
- set underLineList to []
- set numPages to count(gCurrentPageList)
- if gCurrentPage <= numPages then
- set thePage to getAt(gCurrentPageList, gCurrentPage)
- set thePageText to getaProp(thePage, #PageText)
- if stringp(thePageText) then
- set line1 to value(word 1 of thePageText)
- set line2 to value(word 2 of thePageText)
- set theCastNum to value(word 3 of thePageText)
- set theText to getFullText(theCastNum, line2)
- set newText to line line1 to line2 of theText
- repeat while newText contains "<"
- set startChar to offset("<", newText)
- set endChar to offset(">", newText)
- delete char endChar of newText
- delete char startChar of newText
- append(underLineList, [startChar, endChar - 2])
- end repeat
- else
- set newText to EMPTY
- end if
- set pageImageList to getaProp(thePage, #pageImage)
- if listp(pageImageList) then
- set pageImage to getAt(pageImageList, gPlatformNum)
- end if
- set pageMovieList to getaProp(thePage, #pageMovie)
- if listp(pageMovieList) then
- set pageMovie to getAt(pageMovieList, gPlatformNum)
- end if
- set pageMIAWList to getaProp(thePage, #pageMovieInAWindow)
- if listp(pageMIAWList) then
- set pageMovieInAWindow to getAt(pageMIAWList, gPlatformNum)
- end if
- set launchList to getaProp(thePage, #PageLaunch)
- set pageAppList to getaProp(thePage, #pageApp)
- if listp(pageAppList) then
- set pageApp to getAt(pageAppList, gPlatformNum)
- end if
- set zoomImageList to getaProp(thePage, #zoomImage)
- if listp(zoomImageList) then
- set zoomImage to getAt(zoomImageList, gPlatformNum)
- end if
- puppetSprite(gTextFieldChannel, 1)
- if listp(launchList) then
- set fieldLoc to point(313, 143)
- else
- if stringp(pageImage) or stringp(pageMovie) or stringp(zoomImage) then
- set fieldLoc to point(213, 362)
- else
- set fieldLoc to point(213, 143)
- end if
- end if
- if stringp(pageApp) then
- if (the machineType = 256) and not (pageApp contains gAppSuffix) then
- put "." & gAppSuffix after pageApp
- end if
- set theAppToRun to gMediaPath & pageApp
- end if
- set showMovieChannel to 0
- if stringp(pageImage) then
- if the machineType = 256 then
- set suffixOffset to offset(".", pageImage) - 1
- set theImagebase to char 1 to suffixOffset of pageImage
- set theImage to theImagebase & "." & gImageSuffix
- else
- set theImagebase to EMPTY
- set theImage to pageImage
- end if
- set imageCastNum to the number of member theImage
- if (imageCastNum < 0) and (theImagebase <> EMPTY) then
- set imageCastNum to the number of member theImagebase
- end if
- if imageCastNum < 0 then
- makeAlertBox([#PictureNotFound, theImage], "doCancel")
- set showMovieChannel to 0
- set showImageChannel to 0
- else
- if newText <> EMPTY then
- set bgCastNum to ImageAndTextBG
- set MovieLoc to point(417, 246)
- set showImageChannel to 1
- else
- set bgCastNum to ImageBG
- set picWidth to the width of cast imageCastNum
- set picHeight to the height of cast imageCastNum
- if (picWidth <= 320) and (picHeight <= 240) then
- set xloc to 579 - (picWidth / 2)
- set yloc to 387 - (picHeight / 2)
- set MovieLoc to point(xloc, yloc)
- else
- set MovieLoc to point(416, 292)
- end if
- set showImageChannel to 1
- end if
- set showMovieChannel to 1
- puppetSprite(gMovieChannel, 1)
- puppetSprite(gImageChannel, 1)
- set ImageLoc to point(415, 300)
- set the castNum of sprite gImageChannel to bgCastNum
- set the castNum of sprite gMovieChannel to imageCastNum
- preLoadCast(bgCastNum)
- preLoadCast(imageCastNum)
- end if
- else
- set showImageChannel to 0
- end if
- if listp(launchList) then
- set numItems to count(launchList)
- set theLaunchList to [:]
- set the itemDelimiter to ","
- repeat with i = 1 to numItems
- set theSpriteChan to gFirstMenuChannel + i - 1
- set theLaunchInfo to getAt(launchList, i)
- set theAppName to item 1 of theLaunchInfo
- set theMacDocName to item 2 of theLaunchInfo
- set theDocName to item gPlatformNum + 1 of theLaunchInfo
- if theMacDocName = EMPTY then
- set oldDelimiter to the itemDelimiter
- set the itemDelimiter to ":"
- set theIconName to item the number of items in theAppName of theAppName
- set theIconName to theIconName && "icon"
- set the itemDelimiter to oldDelimiter
- if the machineType = 256 then
- set theAppName to theDocName
- end if
- set theDocName to EMPTY
- else
- if theDocName <> EMPTY then
- set oldDelimiter to the itemDelimiter
- set the itemDelimiter to ":"
- set theIconName to item the number of items in theMacDocName of theMacDocName
- set theIconName to theIconName && "icon"
- set the itemDelimiter to oldDelimiter
- else
- set theIconName to theAppName && "icon"
- end if
- end if
- set the castNum of sprite theSpriteChan to the number of member theIconName
- set the locH of sprite theSpriteChan to 248
- set the visible of sprite theSpriteChan to 1
- addProp(theLaunchList, theSpriteChan, theAppName & "," & theDocName)
- end repeat
- end if
- if stringp(zoomImage) then
- if the machineType = 256 then
- set suffixOffset to offset(".", zoomImage) - 1
- set theImagebase to char 1 to suffixOffset of zoomImage
- set theImage to theImagebase & "." & gImageSuffix
- else
- set theImagebase to EMPTY
- set theImage to zoomImage
- end if
- set imageCastNum to the number of member theImage
- if (imageCastNum < 0) and (theImagebase <> EMPTY) then
- set imageCastNum to the number of member theImagebase
- end if
- if imageCastNum < 0 then
- makeAlertBox([#PictureNotFound, theImage], "doCancel")
- set showMovieChannel to 0
- set showImageChannel to 0
- else
- set bgCastNum to ImageAndTextBG
- set MovieLoc to point(417, 246)
- set showImageChannel to 1
- set showMovieChannel to 1
- puppetSprite(gMovieChannel, 1)
- puppetSprite(gImageChannel, 1)
- set ImageLoc to point(415, 300)
- set the castNum of sprite gImageChannel to bgCastNum
- set the castNum of sprite gMovieChannel to imageCastNum
- preLoadCast(bgCastNum)
- preLoadCast(imageCastNum)
- set the stretch of sprite gMovieChannel to 1
- set the width of sprite gMovieChannel to 256
- set the height of sprite gMovieChannel to 192
- set curs to gMagCurs
- set cursMask to gMagCursMask
- set the cursor of sprite gMovieChannel to [curs, cursMask]
- set zoomableImage to 1
- end if
- else
- set the stretch of sprite gMovieChannel to 0
- set the cursor of sprite gMovieChannel to 0
- set zoomableImage to 0
- end if
- if stringp(pageMovie) then
- set onPC to the machineType = 256
- set usingVFW to gMovieSuffix contains "AVI"
- set MacVidInstalled to not onPC and the quickTimePresent
- if usingVFW then
- set WinVidInstalled to onPC and the videoForWindowsPresent
- else
- set WinVidInstalled to onPC and the quickTimePresent
- end if
- if not (MacVidInstalled or WinVidInstalled) then
- if onPC then
- if usingVFW then
- makeAlertBox(#VFWNotInstalled, "doCancel", "doCancel")
- else
- makeAlertBox(#QTWNotInstalled, "doCancel", "doCancel")
- end if
- else
- makeAlertBox(#QuickTimeNotInstalled, "doCancel", "doCancel")
- end if
- set pageMovie to 0
- else
- if onPC then
- set suffixOffset to offset(".", pageMovie) - 1
- set theMovieBase to char 1 to suffixOffset of pageMovie
- set theMovie to theMovieBase & "." & gMovieSuffix
- else
- set theMovieBase to EMPTY
- set theMovie to pageMovie
- end if
- set MovieCastNum to the number of member theMovie
- if (MovieCastNum < 0) and (theMovieBase <> EMPTY) then
- set MovieCastNum to the number of member theMovieBase
- end if
- if MovieCastNum < 0 then
- makeAlertBox([#VideoNotFound, theMovie], "doCancel", "doCancel")
- set showMovieChannel to 0
- set videoPlaying to 0
- set pageMovie to 0
- else
- puppetSprite(gMovieChannel, 1)
- set the castNum of sprite gImageChannel to QTBG
- set ImageLoc to point(416, 300)
- set the type of sprite gMovieChannel to 16
- set the pausedAtStart of cast MovieCastNum to 1
- set the directToStage of cast MovieCastNum to 1
- set the castNum of sprite gMovieChannel to MovieCastNum
- set MovieLoc to point(421, 280)
- set showImageChannel to 1
- set showMovieChannel to 1
- set videoPlaying to 1
- end if
- end if
- else
- set videoPlaying to 0
- end if
- if stringp(pageMovieInAWindow) then
- set theMIAW to pageMovieInAWindow
- if objectp(myMIAW) then
- forget(myMIAW)
- end if
- set sl to the stageLeft
- set st to the stageTop
- set MIAWRect to rect(sl + 261, st + 160, sl + 580, st + 399)
- if the machineType = 256 then
- set theSep to "\"
- else
- set theSep to ":"
- end if
- set myPath to MIAWPath & theMIAW
- set myMIAW to window "Learning Movie"
- if objectp(myMIAW) then
- set the rect of myMIAW to MIAWRect
- set the fileName of myMIAW to myPath
- set the titleVisible of myMIAW to 0
- set the castNum of sprite gImageChannel to QTBG
- set ImageLoc to point(416, 300)
- set showImageChannel to 1
- set MIAWPlaying to 1
- else
- makeAlertBox([#MovieInAWindowNotFound, pageMovieInAWindow], "doCancel", "doCancel")
- end if
- end if
- else
- set newText to EMPTY
- end if
- put newText into field destinationField
- if count(underLineList) > 0 then
- repeat with charList in underLineList
- set startChar to getAt(charList, 1)
- set endChar to getAt(charList, 2)
- set the textStyle of char startChar to endChar of field destinationField to "underline"
- end repeat
- end if
- puppetSprite(gNextPageChannel, 1)
- puppetSprite(gPrevPageChannel, 1)
- if gCurrentPage > 1 then
- set the loc of sprite gPrevPageChannel to point(202, 468)
- else
- set the locH of sprite gPrevPageChannel to -1000
- end if
- if gCurrentPage < numPages then
- set the loc of sprite gNextPageChannel to point(629, 468)
- else
- set the locH of sprite gNextPageChannel to -1000
- end if
- set the visible of sprite gImageChannel to showImageChannel
- set the visible of sprite gMovieChannel to showMovieChannel
- set the visible of sprite gTextFieldChannel to 1
- if showImageChannel then
- set the loc of sprite gImageChannel to ImageLoc
- end if
- if showMovieChannel then
- set the loc of sprite gMovieChannel to MovieLoc
- end if
- set the loc of sprite gTextFieldChannel to fieldLoc
- if stringp(pageMovie) then
- if onPC then
- sound stop 1
- sound stop 2
- end if
- set the visible of sprite QTsliderChannel to 1
- spriteVisibles(27, 31, 1)
- puppetSprite(QTsliderChannel, 1)
- set the stopTime of sprite gMovieChannel to the duration of cast MovieCastNum
- set the movieRate of sprite gMovieChannel to 1
- puppetSprite(QTPlayChannel, 1)
- set the castNum of sprite QTPlayChannel to the number of member "pause.up"
- set videoPlayState to #play
- end if
- if stringp(pageMovieInAWindow) and objectp(myMIAW) then
- set the visible of sprite QTsliderChannel to 1
- spriteVisibles(27, 31, 1)
- puppetSprite(QTsliderChannel, 1)
- open(myMIAW)
- puppetSprite(QTPlayChannel, 1)
- set the castNum of sprite QTPlayChannel to the number of member "pause.up"
- set videoPlayState to #play
- end if
- if stringp(pageApp) then
- nothing()
- end if
- end
-
- on updateSubMenuWindow
- tell SubMenuWindow
- doMenu(field "SubMenu")
- end tell
- alert("Boo!2")
- end
-
- on checkIfOpen aLine
- set LevelsDeep to count(gCurrentMenuHierarchy)
- set LevelSum to 0
- if LevelsDeep > 0 then
- repeat with i = 1 to LevelsDeep
- set LevelSum to LevelSum + getAt(gCurrentMenuHierarchy, i)
- if LevelSum = aLine then
- return 1
- end if
- end repeat
- end if
- return 0
- end
-
- on displaySubMenu thePassedInLine
- global gCurrentSubMenuLines, gCurrentMenuHierarchy, gCurrentMenuList, gCurrentLevelSelect
- if thePassedInLine > 0 then
- set whichLine to thePassedInLine
- else
- set whichLine to gSubMenuLine
- end if
- set oldLevelSelect to gCurrentLevelSelect
- set theTopic to gMenuItemClicked
- set theDepthAndState to getMenuDepth(theTopic)
- set theDepth to getAt(theDepthAndState, 1)
- if theDepth = 1 then
- set gCurrentTopic to theTopic
- set gCurrentSubTopic to EMPTY
- else
- set gCurrentSubTopic to theTopic
- end if
- set theState to getAt(theDepthAndState, 2)
- if theState = "+" then
- set thisMenuOpen to checkIfOpen(whichLine)
- if not thisMenuOpen then
- repeat with i = count(gCurrentMenuHierarchy) down to theDepth
- deleteAt(gCurrentMenuHierarchy, i)
- end repeat
- set thisLevel to getSpecificMenu(gCurrentMenuHierarchy, theDepth, gCurrentMenuList)
- repeat with i = 1 to the number of lines in thisLevel
- if line i of thisLevel contains theTopic then
- append(gCurrentMenuHierarchy, i)
- set gCurrentLevelSelect to [theDepth, i]
- exit repeat
- end if
- end repeat
- set theNewMenu to getSpecificMenu(gCurrentMenuHierarchy, 1, gCurrentMenuList)
- set tempLine to 0
- repeat with i = 1 to count(gCurrentMenuHierarchy)
- set linesDown to getAt(gCurrentMenuHierarchy, i)
- set tempLine to tempLine + linesDown
- put "+" into char (i * 3) - 2 of line tempLine of theNewMenu
- end repeat
- put theNewMenu into field "Submenu"
- tell SubMenuWindow
- doMenu(theNewMenu)
- end tell
- else
- repeat with i = count(gCurrentMenuHierarchy) down to theDepth
- deleteAt(gCurrentMenuHierarchy, i)
- end repeat
- set thisLevel to getSpecificMenu(gCurrentMenuHierarchy, theDepth, gCurrentMenuList)
- set thisTopicName to char theDepth * 3 to length(theTopic) of theTopic
- repeat with i = 1 to the number of lines in thisLevel
- if line i of thisLevel contains thisTopicName then
- set gCurrentLevelSelect to [theDepth, i]
- exit repeat
- end if
- end repeat
- set theNewMenu to getSpecificMenu(gCurrentMenuHierarchy, 1, gCurrentMenuList)
- put theNewMenu into field "Submenu"
- tell SubMenuWindow
- doMenu(theNewMenu)
- end tell
- end if
- end if
- if theState = EMPTY then
- set tempHierarchy to []
- if theDepth > 1 then
- repeat with i = 1 to theDepth - 1
- append(tempHierarchy, getAt(gCurrentMenuHierarchy, i))
- end repeat
- end if
- set thisLevel to getSpecificMenu(tempHierarchy, theDepth, gCurrentMenuList)
- repeat with i = 1 to the number of lines in thisLevel
- if line i of thisLevel contains theTopic then
- set gCurrentLevelSelect to [theDepth, i]
- exit repeat
- end if
- end repeat
- end if
- if count(gCurrentMenuHierarchy) > 0 then
- set currentExpanded to getAt(gCurrentMenuHierarchy, 1)
- else
- set currentExpanded to 0
- end if
- set theLevel to getAt(gCurrentLevelSelect, 1)
- set theSelect to getAt(gCurrentLevelSelect, 2)
- if (theLevel = 1) and (theSelect > currentExpanded) then
- set theLine to whichLine
- else
- set theLine to 0
- repeat with i = 1 to theLevel - 1
- set theLine to theLine + getAt(gCurrentMenuHierarchy, i)
- end repeat
- if count(gCurrentMenuHierarchy) >= theLevel then
- if getAt(gCurrentMenuHierarchy, theLevel) < theSelect then
- set expandedMenu to getSpecificMenu(gCurrentMenuHierarchy, theLevel + 1, gCurrentMenuList)
- set theLine to theLine + the number of lines in expandedMenu
- end if
- end if
- set theLine to theLine + theSelect
- end if
- tell SubMenuWindow
- drawHiliteSubMenu(theLine)
- end tell
- if gCurrentLevelSelect <> oldLevelSelect then
- newDisplayText(gCurrentMenuList, "Submenu Text", thePassedInLine)
- end if
- end
-
- on doInstall
- global watchCursorShowing, jumpedToExternal, InstallerPath, MacInstaller, PCInstaller
- hideHilite(1)
- cursor(4)
- set watchCursorShowing to 1
- if the machineType = 256 then
- set theSep to "\"
- else
- set theSep to ":"
- end if
- set thePath to InstallerPath
- if the machineType <> 256 then
- makeAlertBox([#WaitForApplication, "the installer"], "doCancel")
- set jumpedToExternal to the ticks
- cursor(4)
- open(thePath & MacInstaller)
- else
- makeAlertBox([#WaitForApplication, "the installer"], "doCancel")
- set jumpedToExternal to the ticks
- cursor(4)
- open(thePath & PCInstaller)
- end if
- end
-